﻿@using Organization.Resources
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Application name", "Index", "Home", null, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink(Common.Home, "Index", "Home")</li>
                    <li>@Html.ActionLink(Common.About, "About", "Home")</li>
                    <li>@Html.ActionLink(Common.Contact, "Contact", "Home")</li>
                </ul>

                <ul class="nav navbar-nav pull-right">
                    <li><a href="#" data-lang="en">English</a></li>
                    <li><a href="#" data-lang="vi">Tiếng Việt</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container body-content">

        <div class="row">
            <article class="col-md-9">
                @RenderBody()
            </article>
            <aside class="col-md-3">
                <!--Giỏ hàng-->
                @Html.Partial("_CartInfo")

                <!--Danh mục-->
                @Html.Action("CategoryMenu")

            </aside>
        </div>

        <footer class="row">
            <p>&copy; @DateTime.Now.Year - Nhất Nghệ</p>
        </footer>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
    <script>
        $(function () {
            $("a[data-lang]").click(function () {
                expiry = new Date();
                expiry.setDate(expiry.getDate() + 30);

                lang = $(this).attr("data-lang");
                document.cookie = "lang=" + lang
                    + ";expires=" + expiry.toGMTString() + ";path=/";

                // Tải lại để gửi cookie lên server
                location.reload();
            });
        });
    </script>
</body>
</html>
